<template>
  <div class="el-bg">
    <div class="content-body">

      <div class="el-content">
        <img class="el-google" :src="buttonImage" @click='buttonAction()'>
        <img class="el-google" :src="logoImage"/>
      </div>

    </div>
  </div>
</template>

<script>
  import { add_button_log } from "@/api/linkCredit.js";
export default {
  name: "LinkCredit",
  data() {
    return {
      logoImage: require('../assets/images/link-credit-logo.png'),
      buttonImage: require('../assets/images/but_download.png')
    };
  },
  created() {
    document.title = 'LinkCredit';
  },
  methods: {
    buttonAction() {
      var query=this.$route.query;
      //if(null != query.channel && 'market' == query.channel
      if(null !=query.reqId  && '' != query.reqId){
          let queryData = {
           pageReqId: query.reqId,
           actionType: 'Download LinkCredit'
          };

          add_button_log(queryData).then(response => {
              console.log(response);
              var resultCode = response.code;
              if('200' == resultCode){
                this.doAction();
              }
          });
          return;
      }else{
        this.doAction();
      }
    },
    doAction(){
      window.location.href = 'market://details?id=link.Credit';
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss">
.el-bg {
  /* display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start; */
  height: 100%;
  width: 100%;
  //padding-top: 50%;
  background-image: url("../assets/images/link-credit-new-bg.png");
  background-size:100% 100%;
}

.content-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  position: absolute;
  //-moz-transform: translate(-50%, -50%);
  top: 75%;
  width: 100%;
  //background-color: #0000FF;
}

.el-content {
  line-height: 25px;
  width: 88%;
  text-align: center;
  color: #fff;
  font-family: Arial;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.el-google {
  //margin-top: 20px;
  width: 250px;
  margin-bottom: 20px;
}

</style>
